using System;
using System.Collections;
using System.Collections.ObjectModel;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
using System.IO;
using Darilek.SandcastleExtensions.Components;

namespace Darilek.SandcastleExtensions.Components.Configuration
{
	/// <summary>
	/// Class for describing <see cref="MetaAttributeComponent"/> configuration structure 
	/// </summary>
	[XmlRoot("component", Namespace = "")]
	public class MetaAttributeComponentConfiguration : ComponentConfigurationBase
	{
		private Collection<MetaAttribute> _attributes = null;

		/// <summary>
		/// Constructor
		/// </summary>
		public MetaAttributeComponentConfiguration() : base()
		{
			_attributes = new Collection<MetaAttribute>();
		}

		/// <summary>
		/// Represents &lt;attributes&gt; collection in <see cref="MetaAttributeComponent"/> configuration structure 
		/// </summary>
		[XmlArray("attributes")]
		[XmlArrayItem("attribute")]
		public Collection<MetaAttribute> MetaAttributes
		{
			get
			{
				return _attributes;
			}
		}
	}


	/// <summary>
	/// Represents &lt;attribute&gt; item of &lt;attributes&gt; collection 
	/// in <see cref="MetaAttributeComponent"/> configuration structure 
	/// </summary>
	public class MetaAttribute
	{
		private string _name;
		private string _value;

		/// <summary>
		/// Represents &quot;name&quot; attribute in &lt;attribute&gt; element
		/// </summary>
		[XmlAttribute("name")]
		public string Name
		{
			get { return _name; }
			set { _name = value; }
		}


		/// <summary>
		/// Represents &quot;value&quot; attribute in &lt;attribute&gt; element
		/// </summary>
		[XmlAttribute("value")]
		public string Value
		{
			get { return _value; }
			set { _value = value; }
		}

		/// <summary>
		/// Constructor
		/// </summary>
		public MetaAttribute() : this(String.Empty, String.Empty)
		{
		}


		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="name">Name of meta attribute</param>
		/// <param name="value">Value of meta attribute</param>
		public MetaAttribute(string name, string value)
		{
			_name = name;
			_value = value;
		}

	}
}
